package cn.edu.nju.software.grapheditor.cmd;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Point;
import cn.edu.nju.software.grapheditor.Drawing;
import cn.edu.nju.software.grapheditor.shape.Shape;
/**@author smy*/
public class ColorCmd extends Command{
	  Color col;
	  Shape tobechanged;
	  Graphics g;
      public ColorCmd(Color s,Graphics g){
    	  this.col=s;
    	  this.g=g;
      }
      public void executeClick(Point p, Drawing dwg) {
    	  this.tobechanged=dwg.getFrontmostContainer(p);
    	  tobechanged.setColor(col);
    	  dwg.draw(g);
  	  }
}
